-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apps: add apps propose
command, expand spec validation
#926
Conversation
cd96d97
to
f29cc31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! I'll need an approval from another app engineer to merge this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! One comment in line. Let me know how you want to approach it. If you're fixing on the API side, I'll go ahead and merge.
commands/displayers/apps.go
Outdated
} | ||
|
||
func (r AppProposeResponse) KV() []map[string]interface{} { | ||
staticSites := fmt.Sprintf("%s of %s", r.Res.ExistingStaticApps, r.Res.MaxFreeStaticApps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the API does not return the existing_static_apps
field at all if no static sites are in use. Since it is a string, not an int, the default value is blank rather than 0
. So you end up with:
Free Static Site Usage
of 3
You could handle it here, but you might want to fix that on the API side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @andrewsomething! I updated the representation of free static apps
update apps commands to allow reading from stdin
d67e5be
to
fd442d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doctl apps propose
doctl apps spec validate
-
doctl apps propose
API docs: https://developers.digitalocean.com/documentation/v2/#propose-an-app-spec
Usage:
doctl apps propose --spec spec.yaml [--app app-id]
available app name
unavailable app name
doctl apps spec validate
Added a
--schema-only
flag. Defaults to false. If set, the old behavior of only validating that the spec marshals into agodo.AppSpec
object is retained.If not set, it calls the
ProposeApp
API endpoint.In both cases the command now prints the validated spec instead of a
The app spec is valid
message.some file that's not a spec
valid yaml but invalid spec
happy path - valid spec
The spec I passed in doesn't set the
routes
field